package day0107;

import java.util.Scanner;

public class Test8 {
    public static void main(String[] args) {

        for (int num = 100; num <=999 ; num++) { //100   999
            //2.判断它是否是水仙花数( b*b*b + 十位立方 + 个位立方     ==    三位数)
            //2.1.获取百位、十位、个位的值
            int b = num / 1 % 10;
            int sh = num / 10 % 10;
            int g = num / 100 % 10;
            if( b*b*b + sh*sh*sh + g*g*g == num){
                System.out.println(num + "是水仙花数");
            }
        }

        //1.用Scanner输入身高和体重
        Scanner s=new Scanner(System.in);
        for (int i = 0; i >=0 ; i++) {
            System.out.println("请输入身高(单位-米)：");
            double weight=s.nextDouble();

            System.out.println("请输入体重(单位-千克)：");
            double height=s.nextDouble();

            //2.计算
            double bmi=weight/(height*height);

            //3.判断：  0----18.5偏瘦   18.5----24正常   24以上----偏胖    否则----输入有误
            if(0<bmi  && bmi <18.5){
                System.out.println("偏瘦");
            }else if(18.5<=bmi  && bmi <=24){
                System.out.println("身材完美");
            }else if(24<bmi ){
                System.out.println("偏胖");
            }else{
                System.out.println("输入有误");
            }
        }



    }
}
